]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: Remove isWindowActorDisplayedOnWorkspace
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 14 Jan 2013 17:38:02 +0000 (12:38 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 7 Feb 2013 06:36:31 +0000 (01:36 -0500)
We now have a convenience method in mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=691746

js/ui/main.js
js/ui/workspace.js
js/ui/workspaceThumbnail.js

index a3db5936bbf5ab61a824e28a9375d9d101a0658a..e9775950647f45254a1b17f90f1cd3722b1036c1 100644 (file)
@@ -472,14 +472,11 @@ function notifyError(msg, details) {
     notify(msg, details);
 }
 
-function isWindowActorDisplayedOnWorkspace(win, workspaceIndex) {
-    return win.get_workspace() == workspaceIndex ||
-        (win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
-}
-
 function getWindowActorsForWorkspace(workspaceIndex) {
-    return global.get_window_actors().filter(function (win) {
-        return isWindowActorDisplayedOnWorkspace(win, workspaceIndex);
+    let workspace = global.screen.get_workspace_by_index(workspaceIndex);
+    return global.get_window_actors().filter(function (actor) {
+        let win = actor.meta_window;
+        return win.located_on_workspace(workspace);
     });
 }
 
index bea9a6197f33dc1dfaf6916b6d5d64f9dba9bc6c..8342b188359a7a2236e65c9a59f3e5dbe645c791 100644 (file)
@@ -1532,9 +1532,10 @@ const Workspace = new Lang.Class({
     },
 
     // Tests if @win belongs to this workspaces and monitor
-    _isMyWindow : function (win) {
-        return (this.metaWorkspace == null || Main.isWindowActorDisplayedOnWorkspace(win, this.metaWorkspace.index())) &&
-            (!win.get_meta_window() || win.get_meta_window().get_monitor() == this.monitorIndex);
+    _isMyWindow : function (actor) {
+        let win = actor.meta_window;
+        return (this.metaWorkspace == null || win.located_on_workspace(this.metaWorkspace)) &&
+            (!win.get_monitor() == this.monitorIndex);
     },
 
     // Tests if @win should be shown in the Overview
index b0300f60322e46e382ca34559d8d4f17aaa016f6..fbdc6fb1d8a9c1405cfa462cca2ce4165d475a78 100644 (file)
@@ -176,7 +176,9 @@ const WorkspaceThumbnail = new Lang.Class({
         let monitor = Main.layoutManager.primaryMonitor;
         this.setPorthole(monitor.x, monitor.y, monitor.width, monitor.height);
 
-        let windows = global.get_window_actors().filter(this._isWorkspaceWindow, this);
+        let windows = global.get_window_actors().filter(Lang.bind(this, function(win) {
+            return win.located_on_workspace(metaWorkspace);
+        }));
 
         // Create clones for windows that should be visible in the Overview
         this._windows = [];
@@ -377,15 +379,11 @@ const WorkspaceThumbnail = new Lang.Class({
         this.actor = null;
     },
 
-    // Tests if @win belongs to this workspace
-    _isWorkspaceWindow : function (win) {
-        return Main.isWindowActorDisplayedOnWorkspace(win, this.metaWorkspace.index());
-    },
-
     // Tests if @win belongs to this workspace and monitor
-    _isMyWindow : function (win) {
-        return this._isWorkspaceWindow(win) &&
-            (!win.get_meta_window() || win.get_meta_window().get_monitor() == this.monitorIndex);
+    _isMyWindow : function (actor) {
+        let win = actor.meta_window;
+        return win.located_on_workspace(this.metaWorkspace) &&
+            (!win.get_monitor() == this.monitorIndex);
     },
 
     // Tests if @win should be shown in the Overview